package com.app.common.utils;
import java.util.MissingResourceException;

import java.util.ResourceBundle;

/**
 * 
 * 获取配置资源文件 [公共参数] 信息
 * 
 * @author cuichr
 */

public class CommonParam {

	private String propertyFileName;

	private ResourceBundle resourceBundle;

	public CommonParam() {

		propertyFileName = "SysConfig";

		resourceBundle = ResourceBundle.getBundle(propertyFileName);

	}

	public static String getString(String key) {

		if (key == null || key.equals("") || key.equals("null")) {

			return "";

		}

		String result = "";

		try {
			result = StringUtil.parse2String(new CommonParam().resourceBundle.getString(key));

		} catch (MissingResourceException e) {

			e.printStackTrace();

		}

		return result;

	}
	
	public static void main(String[] args) {

	       System.out.println(CommonParam.getString("hyswitch"));

	}

}
